<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改抽奖用户')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-role-edit" th:object="${wechatUser}">
			<input id="lotteryId" name="lotteryUserId" type="hidden" th:field="*{userId}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">openId：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="openId" id="openId" th:value="*{openId}" required readonly>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">微信昵称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="nickName" id="nickName" th:value="*{nickName}" required readonly>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">性别：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="sex" th:value="*{sex == '0' ? '男' : '女'}" id="sex" required readonly>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">收货地址：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="recAddr" id="recAddr" th:value="*{recAddr}" required readonly>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">关联姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="psnName" id="psnName" th:value="*{psnName}" required readonly>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">关联联系电话：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="tel" id="tel" th:value="*{tel}" required readonly>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		function edit() {
			var lotteryUserId = $("input[name='lotteryUserId']").val();
			var psnName = $("input[name='psnName']").val();
			var tel = $("input[name='tel']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "biz/lotteryUser/edit",
				data : {
					"lotteryUserId": lotteryUserId,
					"psnName": psnName,
					"tel": tel
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
		
		function submitHandler() {
	        /*if ($.validate.form()) {
	        	edit();
	        }*/
	    }
	</script>
</body>
</html>
